package com.peanut.baby.model;

import com.google.gson.annotations.SerializedName;
import com.peanut.baby.util.TimeUtil;

import java.io.Serializable;
import java.util.List;

/**
 * Created by anonymouslystudio on 2017/7/18.
 */

public class LiveRoom implements Serializable{
    public static final int ROOM_STATUS_WAITING = 1;
    public static final int ROOM_STATUS_LIVING = 2;
    public static final int ROOM_STATUS_FINISHED = 3;

    @SerializedName("roomImageUrl")
    public String roomImageUrl;
    @SerializedName("serverName")
    public String serverName;
    @SerializedName("allowCount")
    public String allowCount;
    @SerializedName("expertSummary")
    public String expertSummary;
    @SerializedName("expertSpecialty")
    public String expertSpecialty;
    @SerializedName("title")
    public String title;
    @SerializedName("summary")
    public String summary;
    @SerializedName("isEnroled")
    public int isEnroled;
    @SerializedName("endTime")
    public String endTime;
    @SerializedName("roomStatus")
    public int roomStatus;
    @SerializedName("roomId")
    public int roomId;
    @SerializedName("consumePoint")
    public String consumePoint;
    @SerializedName("expertId")
    public String expertId;
    @SerializedName("serverId")
    public String serverId;
    @SerializedName("startTime")
    public String startTime;


    @SerializedName("expertJobTitle")
    public String expertJobTitle;
    @SerializedName("expertHospital")
    public String expertHospital;
    @SerializedName("expertAvatar")
    public String expertAvatar;
    @SerializedName("expertDepartment")
    public String expertDepartment;
    @SerializedName("expertName")
    public String expertName;

    @SerializedName("enrolCount")
    public String enrolCount;

    @SerializedName("liveDate")
    public String liveDate;


    @SerializedName("welcome")
    public String welcome;
    @SerializedName("playStatus")
    public int playStatus;

    public List<LiveRoom> group;

    @SerializedName("liveGroup")
    public LiveGroup liveGroup;


    @Override
    public String toString() {
        return "LiveRoom{" +
                "roomImageUrl='" + roomImageUrl + '\'' +
                ", serverName='" + serverName + '\'' +
                ", allowCount='" + allowCount + '\'' +
                ", expertSummary='" + expertSummary + '\'' +
                ", expertSpecialty='" + expertSpecialty + '\'' +
                ", title='" + title + '\'' +
                ", summary='" + summary + '\'' +
                ", isEnroled='" + isEnroled + '\'' +
                ", endTime='" + endTime + '\'' +
                ", roomStatus='" + roomStatus + '\'' +
                ", roomId='" + roomId + '\'' +
                ", consumePoint='" + consumePoint + '\'' +
                ", expertId='" + expertId + '\'' +
                ", serverId='" + serverId + '\'' +
                ", startTime='" + startTime + '\'' +
                ", expertJobTitle='" + expertJobTitle + '\'' +
                ", expertHospital='" + expertHospital + '\'' +
                ", expertAvatar='" + expertAvatar + '\'' +
                ", expertDepartment='" + expertDepartment + '\'' +
                ", expertName='" + expertName + '\'' +
                ", enrolCount='" + enrolCount + '\'' +
                ", liveDate='" + liveDate + '\'' +
                ", welcome='" + welcome + '\'' +
                '}';
    }

    public String getStatusString(){
        if(roomStatus == ROOM_STATUS_WAITING){
            return "等待直播";
        }else if(roomStatus == ROOM_STATUS_LIVING){
            return "直播中";
        }else if(roomStatus == ROOM_STATUS_FINISHED){
            return "回放中";
        }
        return "未知状态";
    }
    public String getPriceString(){
        if(consumePoint.equals("0")){
            return "免费";
        }
        return consumePoint+"花生壳";
    }
    public String getTimeString(){

        return liveDate+" "+startTime+"-"+endTime+" "+ TimeUtil.getWeekString(liveDate);
    }

}
